
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/

#ifndef DVPP_SVM_MEM_CTRL_H
#define DVPP_SVM_MEM_CTRL_H

#include <linux/types.h>

typedef struct {
    uint64_t *pa_list;
    uint64_t *size_list;
    uint64_t num;
    uint64_t page_size;
} dvpp_svm_pa_info; // 如果结构体变大，需修改DVPP_DEFAULT_MEM_BLK_SIZE

uint64_t dvpp_get_page_size(pid_t pid, uint64_t addr, uint64_t size);
uint64_t dvpp_get_pa_num(uint64_t addr, uint64_t size, uint64_t page_size);
int32_t dvpp_get_pa_list_from_svm_addr(pid_t pid, uint64_t addr, uint64_t size, dvpp_svm_pa_info *pa_info);
void dvpp_put_pa_list(pid_t pid, uint64_t addr, uint64_t size, dvpp_svm_pa_info *pa_info);

#endif  // #ifndef DVPP_SVM_MEM_CTRL_H